package com.androidx.p013lv.base.utils;

import android.text.TextUtils;
import org.json.JSONException;
import org.json.JSONObject;

/* renamed from: com.androidx.lv.base.utils.JsonUtils */
public class JsonUtils {
    public static String getString(String str, String str2) {
        if (TextUtils.isEmpty(str2)) {
            return "";
        }
        try {
            return new JSONObject(str2).optString(str);
        } catch (JSONException e) {
            e.printStackTrace();
            return "";
        }
    }

    public static int getInt(String str, String str2) {
        if (TextUtils.isEmpty(str2)) {
            return 0;
        }
        if (str2.startsWith("﻿")) {
            str2 = str2.substring(1);
        }
        JSONObject jSONObject = null;
        try {
            jSONObject = new JSONObject(str2);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jSONObject.optInt(str);
    }
}
